package com.jemmyee.task.web.controller.front;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.jemmyee.core.web.Constants;
import com.jemmyee.core.web.utils.MathUtils;
import com.jemmyee.task.web.controller.kernel.BaseTaskFrontController;

/**
 * @Description:user前台Controller
 * @author:jemmyee@gmail.com
 * @date:2011-8-4
 * @version:v1.0
 */
@Controller("userTaskFrontController")
@RequestMapping(Constants.MV_URI_APP_TASK+Constants.MV_URI_MAIN_SSL+Constants.SYM_PATH_SEPARATOR+Constants.ENTITY_USER) 
public class UserController extends BaseTaskFrontController{
	
	private static Log log= LogFactory.getLog(UserController.class);
	/*分页查出保存的条件*/
	private static final String ENTITY_SESSION_BEAN="admin_session_bean_"+MathUtils.getRandomDouble();
	private static final String ROOT_VIEW=Constants.MV_URI_MAIN_FRONT+Constants.MV_URI_APP_TASK+Constants.SYM_PATH_SEPARATOR+Constants.ENTITY_USER;
	private static final String ROOT_URI=Constants.MV_URI_APP_TASK+Constants.MV_URI_MAIN_SSL+Constants.SYM_PATH_SEPARATOR+Constants.ENTITY_USER;
	
	@RequestMapping("/menu")
	public ModelAndView menu(HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.setViewName(ROOT_VIEW+"/menu"); 
		return mv;
	}
	
	@RequestMapping("/info")
	public ModelAndView info(HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.setViewName(ROOT_VIEW+"/info"); 
		return mv;
	}
	@RequestMapping("/main")
	public ModelAndView main(HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.setViewName(ROOT_VIEW+"/main"); 
		return mv;
	}
	@RequestMapping("/toPersonal")
	public ModelAndView toPersonal(HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.setViewName(ROOT_VIEW+"/personal"); 
		return mv;
	}
	
	/**
	* @Description:账户充值界面
	* @author:jemmyee@gmail.com
	* @date:2011-9-6
	*/
	@RequestMapping("/toChargeTabs")
	public ModelAndView toChargeTabs(HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.setViewName(ROOT_VIEW+"/charge_tabs"); 
		return mv;
	}
	/**
	 * @Description:发布点充值 兑现tab
	 * @author:jemmyee@gmail.com
	 * @date:2011-9-6
	 */
	@RequestMapping("/toPointsTabs/{tabID}")
	public ModelAndView toPointsTabs(@PathVariable int tabID,HttpServletRequest request){
		ModelAndView mv=new ModelAndView();
		mv.addObject("tabID",tabID);
		mv.setViewName(ROOT_VIEW+"/points_tabs"); 
		return mv;
	}
}
